<template>
  <div>
    <!-- 详情页链接 -->
    <router-link
      :to="`/menudetails/${cid}/${0}`"
    >
      <div class="menuRow">
        <img class="img-card" :src="`/img/menupic/${hot[0].menu_picture}`"/>
        <div class="content">
          <div class="name">{{hot[0].dishes}}</div>
          <div class="desc">测试文字测试文字测试文字测试文字测试文字测试文字测试文字</div>
          <div class="browse-info">
            <div class="view-count">10人浏览</div>
            <div class="favorite-count">12人收藏</div>
          </div>
        </div>
      </div>
    </router-link>
  </div>
</template>
<script>
export default {
  name: "menuRow",
  props: ['cid'],
  data(){
    return{
      hot:[{menu_picture:"",dishes:""}]
    }
  },
  mounted(){
    // console.log(this.cid)
    this.axios.get(`/menu/hot?cid=${this.cid}`).then(result=>{
      // console.log(result.data.result)
      this.hot=result.data.result;
      // console.log(this.hot)
    })
  },
  methods: {

  },
};
</script>

<style scoped>
.menuRow {
  display: flex;
  display: -webkit-flex;
  align-items: center;
  border-radius: 5px;
  box-shadow: 5px 5px 5px #dddddd;
  border: 1px solid #dddddd;
}

.img-card {
  max-width: 25%;
  max-height: 80%;
  border-radius: 5px 0 0 5px;
}

.content {
  display: flex;
  flex-direction: column;
  flex: 4;
  display: -webkit-flex;
  flex-direction: column;
  /*justify-content: space-around;*/
  width: 100%;
  padding: 0 10px;
  overflow: hidden;
  font-size: 10pt;
  color: #6d6d72;
}

.name {
  flex: 1;
  align-self: flex-start;
  padding-top: 5px;
  font-size: 12pt;
}

.desc {
  flex: 2;
  padding-top: 10px;
  padding-bottom: 10px;
  color: gray;
  font-size: 10pt;
  overflow: hidden;
  text-overflow: ellipsis;
  /*white-space: nowrap;*/
}

.browse-info {
  flex: 1;
  display: flex;
  display: -webkit-flex;
  margin-right: 20px;
  padding-bottom: 5px;
  color: gray;
}

.view-count {
  flex: 1;
  -webkit-flex: 1;
  text-align: left;
}

.favorite-count {
  flex: 1;
  -webkit-flex: 1;
  text-align: right;
}
</style>
